
#ifndef ios_bi_demo_sdk_bi_constrains_h
#define ios_bi_demo_sdk_bi_constrains_h

#define XG_DATA_Log(fmt, ...) NSLog((@"XGSDK DATA\t(%s:%d) " fmt),[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__LINE__, ##__VA_ARGS__)

#define XGSDK_CACHE_DIR @"xgsdk_bi"
#define XGSDK_CACHE_ASA_DIR @"xgsdk_bi_asa"
#define XGSDK_CACHE_FILE_PREFIX @"cache_"
#define XGSDK_CACHE_ASA_FILE_PREFIX @"asa_cache_"

// 定义http参数
#define XGSDK_BI_CONFIG_URL @"http://test.xgsdk.com:6001/bisdk/config"
#define XGSDK_BI_SERVER @"http://test.xgsdk.com:6001/bisdk/push"
#define XGSDK_HTTP_TIMEOUT 30  //HTTP超时时间，单位秒
#define XGSDK_HTTP_RETRY_INTERVAL 200 //HTTP失败重试的间隔，单位秒
#define XGSDK_MAX_QUEUE_LENGTH 1000 //消息队列最大长度
#define XGSDK_MAX_FILE_NUM 1000  //本地最多缓存的文件
#define XGSDK_SEND_BATCH_SIZE 50 //单次发送的最大消息数
#define XGSDK_SEND_INTERVAL 10 //消息发送间隔,单位秒

// 定义消息类型
// 设备启动client.device.start
#define XGSDK_MSG_TYPE_INIT @"sdk.init"
#define XGSDK_MSG_TYPE_GAME_START @"device.connect"
#define XGSDK_MSG_TYPE_ACCT_LOGIN @"account.login"
#define XGSDK_MSG_TYPE_ROLE_LOGIN @"role.login"
#define XGSDK_MSG_TYPE_ACCOUNT_REGIST @"account.regist"
#define XGSDK_MSG_TYPE_ROLE_REGIST @"btRegister"
#define XGSDK_MSG_TYPE_ROLE_RECHARGE @"role.recharge"
#define XGSDK_MSG_TYPE_PUSH @"message.push"
#define XGSDK_MSG_TYPE_VIRTUAL_PURCHASE @"virtualcurrency.purchase"
#define XGSDK_MSG_TYPE_VIRTUAL_REWARD @"virtualcurrency.reward"
#define XGSDK_MSG_TYPE_VIRTUAL_CONSUME @"virtualcurrency.consume"
#define XGSDK_MSG_TYPE_ROLE_GAIN_GOLD @"role.gaingold"
#define XGSDK_MSG_TYPE_ROLE_LEVEL @"role.level"
#define XGSDK_MSG_TYPE_ROLE_MISSION @"role.mission"
#define XGSDK_MSG_TYPE_ON_EVENT @"custom.event"
#define XGSDK_MSG_TYPE_HEART @"device.heartbeat"
#define XGSDK_MSG_TYPE_DELAY @"network.delay"

#define XGSDK_MSG_TYPE_FIRST @"bteventfirst"

#define ON_EVNET_ROLE_ROLE_REGIST @"role.regist"



/*===================1.0统计事件============================*/
// 游戏暂停client.sys.pause
#define XGSDK_MSG_TYPE_GAME_PAUSE @"sys.pause"

// 游戏恢复lient.sys.resume
#define XGSDK_MSG_TYPE_GAME_RESUME @"sys.resume"
#define XGSDK_MSG_TYPE_CRASH @"sys.crash"



#define MSG_VERSION @"2.0"
//#define DATA_VERSION @"1.0.0"

//请求策略的地址
#define STRATEGY_BT_CONFIG_URL @"https://sdkserver.seasungame.com/api/conf/"
#define STRATEGY_LOCAL_URL @"http://localhost:7071/strategy/service/config.do "
#define STRATEGY_URL @"http://sdk.whale.xoyo.com/strategy/service/config.do"
#define STRATEGY_URL @"http://sdk.whale.xoyo.com/strategy/service/config.do"
//策略事件
#define STRATEGY_EVENTS @"strategyEvents"
#define STRATEGY_ALL @"strategyAll"

// 定义header属性
#define HEADER_TIME_KEY @"batchTimestamp"
#define HEADER_ASA_PHONE_TIME @"btAsaPhonetime"
#define HEADER_BATCH_DATA_ID @"batchDataId"
#define HEADER_DATA_SOURCE @"datasource"
#define HEADER_APP_ID @"appId"
#define HEADER_BT_APP_ID @"btAppId"
#define HEADER_MESSAGE_VERSION @"msgVersion"
#define HEADER_XG_VERSION @"xgVersion"
#define HEADER_DATA_VERSION @"xgDataVersion"
#define HEADER_CHANNEL_ID @"channel"
#define HEADER_CHANNEL_DESC @"channelDesc"
#define HEADER_TRADE_ID @"traceId"
#define HEADER_DEV_KEY @"deviceId"
#define HEADER_SIMPLE_UUID @"uuid"
#define HEADER_OS @"os"
#define HEADER_NETWORK @"network"
#define HEADER_CLIENT_IP @"whale_clientIp"
#define HEADER_SDK_VERSION @"sdkVersion"
#define HEADER_BT_DEVICE_ID @"btDeviceId"
#define HEADER_APP_VERSION @"appVersion"
#define HEADER_APP_VERSION_CODE @"appVersionCode"
#define HEADER_OS_VERSION @"osVersion"
#define HEADER_CPU_FREQ @"cpuFreq"
#define HEADER_MEM_TOTAL @"memTotal"
#define HEADER_DEVICE_BRAND @"deviceBrand"
#define HEADER_DEVICE_MODEL @"deviceModel"
#define HEADER_DEVICE_BROKEN @"isJailBroken"
#define HEADER_DEVICE_PIRATED @"isPirated"
#define HEADER_DEVICE_SCREEN @"deviceScreen"
#define HEADER_CARRIER @"carrier"
#define HEADER_COUNTRY @"country"
#define HEADER_LANGUAGE @"language"
#define HEADER_MAC_ADRESS @"mac"
#define HEADER_USER_PRIVACY_AGREEMENT @"privacyAgreement"
#define HEADER_MSG_REG @"msgSeq"
#define HEADER_ZONE_ID @"clientTimeZoneId"
#define HEADER_CLIENT_COUNTRY @"clientCountry"
#define HEADER_IDFA @"idfa"
#define HEADER_UA @"userAgent"
#define HEADER_UA_ERROR @"userAgentError"
#define HEADER_BUNDLEID @"packageName"
// 时间
#define HEADER_UPTIME @"btUploadTimeStamp"
// 开机时间
#define HEADER_BOOT_TIME @"btBootTimeInSec"
// 设备名称
#define HEADER_DEVICE_NAME @"btDeviceName"
#define HEADER_DEVICE_NAME_MD5 @"btDeviceNameMD5"
// 设备machine
#define HEADER_MACHINE @"btMachine"
// 物理内存
#define HEADER_MEMORY @"btMemory"
// 硬盘容量
#define HEADER_DISK @"btDisk"
// 系统更新时间
#define HEADER_SYSFILETIME @"btSysFileTime"
// model
#define HEADER_MODEL @"btModel"
#define HEADER_TIMEZONE @"time_zone"

#define HEADER_MNTID @"btMntId"
#define HEADER_FILEINITTIME @"btFileInitTime"

// 定义attribute公用属性
#define COMMON_ATTR_MSG_TYPE @"msgType"
#define COMMON_ATTR_MSG_ID @"msgId"
#define COMMON_ATTR_IDFV @"idfv"
#define COMMON_ATTR_EXT @"ext"
#define COMMON_ATTR_SESSION_ID @"onlineSessionId"
#define COMMON_ATTR_TIMESTAMP @"timestamp"
#define COMMON_ATTR_AUTH_TOKEN @"xgAuthToken"
// 埋点的时间，初始化就是系统时间没初始化就是
#define COMMON_ATTR_CREATE_TIMESTAMP @"btCreateTimeStamp"
#define COMMON_ATTR_TIME_TYPE @"btTimeType"

#define COMMON_ATTR_AUTH_TOKEN @"xgAuthToken"
#define COMMON_ATTR_AUTH_TOKEN @"xgAuthToken"


#define XGSDK_MODEL @"model"
#define XGSDK_SYSTEM_NAME @"systemName"
#define XGSDK_SYSTEM_VERSION @"systemVersion"
#define XGSDK_APP_NAME @"appName"
#define XGSDK_APP_SHORT_VERSION @"appShortVersion"
#define XGSDK_APP_BUNDLE_VERSION @"appBundelVersion"
#define XGSDK_APP_IDENTIFY @"appIdentify"

// login
#define LOGIN_MSG_ACCT_KEY @"accountId"
#define LOGIN_MSG_LOGIN_TYPE @"loginFlag"
#define LOGIN_MSG_ZONE_KEY @"zone"
#define LOGIN_MSG_SERVER_KEY @"server"
#define LOGIN_MSG_SERVER_NAME_KEY @"serverName"
#define LOGIN_MSG_ROLE_ID_KEY @"roleId"
#define LOGIN_MSG_ROLE_NAME_KEY @"roleName"
#define LOGIN_MSG_ROLE_TYPE_KEY @"roleType"
#define LOGIN_MSG_ROLE_LEVER_KEY @"roleLevel"
#define XGSDK_SN_KEY @"sn"
#define XGSDK_ROLE_DURATION @"roleDuration"
#define XGSDK_ACCT_DURATION @"acctDuration"
#define XGSDK_LOGIN_DURATION @"loginDuration"
#define XGSDK_EVENT_ID_KEY @"eventID"
#define XGSDK_ROLEINFO_GENDER_KEY @"gender"
#define XGSDK_ROLEINFO_ROLEVIPLEVEL_KEY @"roleVipLevel"
#define XGSDK_ROLEINFO_ZONENAME_KEY @"zoneName"
#define XGSDK_ROLEINFO_PARTYNAME_KEY @"partyName"
#define XGSDK_ROLEINFO_BALANCE_KEY @"balance"
#define XGSDK_ROLEINFO_AGEINGAME_KEY @"ageInGame"
#define XGSDK_ROLEINFO_ACCOUNTAGEINGAME_KEY @"accountAgeInGame"
#define XGSDK_ROLEINFO_ROLEFIGURE_KEY @"roleFigure"
#define XGSDK_ROLEINFO_EXT_KEY @"ext"

#define regist
#define XGSDK_ACCOUNT_REGIST_KEY @"$bt_account_regist"
#define XGSDK_ROLE_REGIST_KEY @"$bt_role_regist"

//push
#define PUSH_MSG_MSG_ID @"push_msg_id"
#define PUSH_MSG_PUSH_PROCESS @"push_process"
#define PUSH_MSG_PUSH_AFTER_OPEN @"push_after_open"
#define PUSH_MSG_PUSH_DEVICE_TOKEN @"push_device_token"
#define PUSH_MSG_PUSH_ALIAS @"push_alias"
#define PUSH_MSG_PUSH_ALIAS_TYPE @"push_alias_type"
#define PUSH_MSG_MSG_TYPE @"push_msg_type"

//recharge
#define RECHARGE_MSG_CHANNEL @"rechargeChannel"
#define RECHARGE_MSG_CURRENCY @"currency"
#define RECHARGE_MSG_MONEY @"money"
#define RECHARGE_MSG_GOLD @"gold"
#define RECHARGE_MSG_GAMETRADENO @"gameTradeNo"
#define RECHARGE_MSG_CURRENCYNAME @"virtualCurrencyType"
#define RECHARGE_MSG_CURRENCYTOTAL @"virtualCurrencyTotal"
#define RECHARGE_MSG_GAINCHANNELTYPE @"gainChannelType"
#define RECHARGE_MSG_ITEM_NAME @"itemName"
#define RECHARGE_MSG_GAIN_CHANNEL @"gainChannel"
#define RECHARGE_MSG_BIND_GOLD @"bindingGold"
#define RECHARGE_MSG_GAME_TRADE_NO @"gameTradeNo"
#define RECHARGE_MSG_ITEM_NUM @"itemNum"
#define RECHARGE_MSG_TIME_TYPE @"itemType"

#define RECHARGE_MSG_PRODUCTID @"productId"
#define RECHARGE_MSG_STATE @"state"
#define RECHARGE_MSG_ORDERCREATECODE @"nOrderCreateCode"
#define RECHARGE_MSG_SZOORDERCREATEMSG @"szOrderCreateMsg"
#define RECHARGE_MSG_MSGCODE @"msgCode"



//mission
#define MISSION_TIMES_KEY @"doMissionTimes"
#define MISSION_ROLECURRENTPOWER_KEY @"roleCurrentPower"
#define MISSION_ID_KEY @"missionId"
#define MISSION_NAME_KEY @"missionName"
#define MISSION_FLAG_KEY @"missionFlag"
#define MISSION_DURATION_KEY @"missionDuration"
#define MISSION_SUCCESS_KEY @"success"
#define MISSION_FAILED_KEY @"failed"
#define MISSION_BEGIN_KEY @"enter"


//onEvent
#define ON_EVENT_ID @"eventId"
#define ON_EVENT_BODY @"eventBody"
#define ON_EVENT_VALUE @"eventVal"
#define ON_EVNET_DESC @"eventDesc"
#define ON_EVNET_SEND_TYPE_KEY @"sendType"
#define ON_EVNET_SEND_TYPE_SYNC @"sync"
#define ON_EVENT_TIMECOSTMILLS @"timeCostMills"

 

// method
#define INVOKE_METHOD_KEY @"invokemethod"
#define INVOKE_ON_EVENT @"onEvent"
#define INVOKE_CATEGORY_STAT @"onCategoryStat"
#define INVOKE_ON_STEP @"onStep"
#define INVOKE_TIME_COST @"onTimeCost"


//network
#define NETWORK_DELAY @"delay"
#define NETWORK_IS_PASS @"isPingPassed"
#define NETWORK_LOST_PACKAGE @"lostPackage"
#define NETWORK_SERVER_HOST @"serverHost"

// NSNotificationCenter
#define kSeasunGameWhaleSDKUserAuthNotification @"kDefineSeasunGameWhaleSDKUserAuthNotification"

// NSUserDefaults
#define kUserAuthInit @"XGBTUserAuthInit"

#endif
